package com.javatian.dao;

import com.javatian.entity.CommentInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 商品评价信息Dao
 */
@Repository
public interface CommentInfoDao extends Mapper<CommentInfo> {
    /*获取某个商品的评价信息列表*/
    List<CommentInfo> findByGoodsId(@Param("goodsId") Long goodsId);

    /*根据内容，用户购买查评价信息列表*/
    List<CommentInfo> findByContent(@Param("content")String content,@Param("userId")Long userId,@Param("level")Integer level);

    /*查询某商品某用户已经评价过的评价列表*/
    List<CommentInfo> findByGoodsIdAndUserId(@Param("goodsId") Long goodsId,@Param("userId")Long userId,@Param("level")Integer level);
}
